<?php
$id = @$_GET['id'];
$box_title= "Add/Edit Messages";
$box_contents = "";

$temp =  sql_query("SELECT * FROM messages WHERE id=\"$id\"");
$res = sql_fetch_row($temp);

$box_contents .= "<form action=\"index.php?m=messages&a=dosql&id=$id\" method=\"post\">";
$box_contents .= "<table border=\"0\" cellpadding=\"2\" cellspacing=\"2\">";
$box_contents .= "<tr><td>Subject: </td><td><input type=\"text\" name=\"subject\" size=\"45\"></td></tr>";
$box_contents .= "<tr><td>Message: </td><td><textarea name=\"message\" cols=\"65\" rows=\"12\">".$res['message']."</textarea></td></tr>";
$box_contents .= "<tr><td><input type=\"submit\" value=\"Save Now\"></td></tr>";
$box_contents .= "</table>";
$box_contents .= "</form>";
?>